{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "https://leetcode.com/problems/check-if-n-and-its-double-exist/\n",
    "\n",
    "\n",
    "\n",
    "Runtime: 0 ms, faster than 100.00% of C++ online submissions for Check If N and Its Double Exist.\n",
    "Memory Usage: 10.3 MB, less than 62.72% of C++ online submissions for Check If N and Its Double Exist.\n",
    "\n",
    "\n",
    "\n",
    "```cpp\n",
    "#include <vector>\n",
    "#include <bits/stdc++.h>\n",
    "#include <algorithm>\n",
    "\n",
    "using namespace std;\n",
    "\n",
    "class Solution {\n",
    "public:\n",
    "    bool checkIfExist(vector<int>& arr) {\n",
    "        for (int i=0; i < arr.size(); ++i) {\n",
    "            int v = arr[i];\n",
    "            int d_v = v * 2;\n",
    "            auto found = find(arr.begin(), arr.end(), d_v);\n",
    "            if (found != arr.end()) {\n",
    "                if ((found - arr.begin()) != i) {\n",
    "                    return true;\n",
    "                }\n",
    "            }\n",
    "        }\n",
    "        return false;\n",
    "    }\n",
    "};\n",
    "```"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "C++17",
   "language": "C++17",
   "name": "xcpp17"
  },
  "language_info": {
   "codemirror_mode": "text/x-c++src",
   "file_extension": ".cpp",
   "mimetype": "text/x-c++src",
   "name": "c++",
   "version": "17"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
